import { http } from '@/utils/axios';
import { LoginReq } from '@/types/modules/login';

export function loginBySmsCode(data: LoginReq) {
  return http.request<string>({
    url: '/v1/basic/login/login-code',
    method: 'POST',
    data,
  });
}

export function loginByPassword(data: LoginReq) {
  return http.request<string>({
    url: '/v1/basic/login/login-password',
    method: 'POST',
    data,
  });
}

export function sendSmsCode(phone: string) {
  return http.request({
    url: '/v1/basic/login/send-mobile-code',
    method: 'POST',
    data: {
      phone,
    },
  });
}
